package com.ling.pl.autoproject.definition.entity.model;

import com.ling.pl.core.commons.annotation.Dict;
import com.ling.pl.core.commons.annotation.ModelProperty;
import com.ling.pl.core.model.impl.BaseEntity;

import javax.persistence.Column;

public class Entity extends BaseEntity {
    //实体信息
    @Column(name = "NAME", length = 150)
    @ModelProperty(comment = "中文名称")
    String name;

    @Column(name = "NAME_I18N", length = 150)
    @ModelProperty(comment = "中文名称")
    String nameI18n;

    @Column(name = "TABLE_NAME", length = 150)
    @ModelProperty(comment = "表/文档/名称", des = "相当于表名")
    String tableName;

    @Column(name = "CLASSNAME", length = 150)
    @ModelProperty(comment = "类名")
    String className;

    @Column(name = "MODEL_TYPE", length = 150)
    @ModelProperty(comment = "实体类型")
    @Dict(code = "builder.entity.entityType", des = "主实体,附属实体,关系实体")
    String entityType;

    @Column(name = "MODULE_ID", length = 36)
    @ModelProperty(comment = "模块id")
    String moduleId;

    @Column(name = "IS_ORACLE_SUPPORT")
    @ModelProperty(comment = "虚拟实体")
    Boolean isVisual;

    @Column(name = "IS_LOGIC_FLAG")
    @ModelProperty(comment = "启用逻辑有效")
    Boolean isLogicFlag;

    @Column(name = "LOGIC_TRUE")
    @ModelProperty(comment = "逻辑有效值")
    String logicTrue;

    @Column(name = "LOGIC_FALSE")
    @ModelProperty(comment = "逻辑无效值")
    String logicFalse;

    @Column(name = "IS_SUBSYSTEM")
    @ModelProperty(comment = "子系统实体")
    Boolean isSubSystem;

    @Column(name = "IS_TEMP")
    @ModelProperty(comment = "启用临时数据")
    Boolean isTemp;

    @Column(name = "INDEX_TYPE", length = 50)
    @ModelProperty(comment = "索引类型")
    @Dict(code = "builder.entity.indexType", des = "索引主实体,继承主实体")
    String indexType;

    @Column(name = "STORAGE_TYPE", length = 50)
    @ModelProperty(comment = "存储类型")
    @Dict(code = "builder.entity.storageType", des = "无存储,SQL,NOSQL,SQL&NOSQL")
    String storageType;

    @Column(name = "ENTITY_VERSION")
    @ModelProperty(comment = "模型版本")
    Integer entityVersion;

    @Column(name = "PROPERTY_VERSION")
    @ModelProperty(comment = "数据结构版本")
    Integer propertyVersion;

    //数据库存储

    @Column(name = "SUPER_MODEL_ID", length = 36)
    @ModelProperty(comment = "主表名称", des = "类似MappedSuperclass,结构继承,或对已有功能的扩展")
    String superModel;

    @Column(name = "IS_VIEW")
    @ModelProperty(comment = "无视图模式")
    Boolean isView = false;

    @Column(name = "VIEW_LEVEL", length = 50)
    @ModelProperty(comment = "视图列级别")
    @Dict(code = "builder.entity.viewLevel", des = "默认(全部数据),2(无行外数据),3关键数据,4个别字段")
    String viewLevel;

    @Column(name = "DEFAULT_DATASOURCE", length = 50)
    @ModelProperty(comment = "默认数据源")
    String defaultDatasource;

    @Column(name = "REQUIREMENT_ID", length = 36)
    @ModelProperty(comment = "系统设计需求id")
    String requirementId;

    @Column(name = "TODO", length = 500)
    @ModelProperty(comment = "todo")
    String todo;

    @Column(name = "REMARK", length = 500)
    @ModelProperty(comment = "备注")
    String remark;

    //控制逻辑
    @Column(name = "IS_MULTI_FORM")
    @ModelProperty(comment = "启用多表单")
    Boolean isMultiForm = false;

    @Column(name = "IS_ORG")
    @ModelProperty(comment = "启用组织模型")
    Boolean isOrg;

    @Column(name = "IS_WORKFLOW")
    @ModelProperty(comment = "启用工作流模型")
    Boolean isWorkFlow;

    @Column(name = "IS_AUDIT")
    @ModelProperty(comment = "启用审计模型")
    Boolean isAudit;

    @Column(name = "AUDIT_TYPE", length = 50)
    @ModelProperty(comment = "启用审计模型")
    @Dict(code = "builder.entity.auditType", des = "基本审计,详细审计(含变化记录)")
    String auditType;

    @Column(name = "DATA_SECURITY_TYPE", length = 50)
    @ModelProperty(comment = "数据访问控制方式")
    @Dict(code = "builder.entity.dataSecurityType", des = "无控制,自控制,附属主实体控制")
    String dataSecurityType;

    @Column(name = "IS_EXPOSE_SERVICE")
    @ModelProperty(comment = "默认发布行为服务")
    Boolean isExposeService;

    @Column(name = "VIRTUAL_SEPARATOR", length = 10)
    @ModelProperty(comment = "虚拟主键分隔符")
    String virtualSeparator;

    @Column(name = "DATA_CHANGE_LOG_TYPE", length = 50)
    @ModelProperty(comment = "数据变更日志类型")
    @Dict(code = "builder.entity.dataChageLogType", des = "启用实体数据同步需要配置日志类型,单项数据(同步),单项数据(含关联数据)(同步),单项数据(异步),单项数据(含关联数据)(异步)")
    String dataChageLogType;

    @Column(name = "OTHER_PARAMS", length = 250)
    @ModelProperty(comment = "其他参数")
    String params;
}
